﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace YJY_DMZS
{
    public partial class FrmNavigation : XtraForm
    {
        public FrmNavigation()
        {
            InitializeComponent();
        }

        private void FrmNavigation_Load(object sender, EventArgs e)
        {
            //pnlCenter.Left = (this.Width - pnlCenter.Width) / 2 > 0 ? (this.Width - pnlCenter.Width) : 0;
            //pnlCenter.Top = (this.Height - pnlCenter.Height) / 2 > 0 ? (this.Height - pnlCenter.Height) / 2 : 0;

        }

        private void FrmNavigation_SizeChanged(object sender, EventArgs e)
        {
            //pnlCenter.Left = (this.Width - pnlCenter.Width) / 2 > 0 ? (this.Width - pnlCenter.Width) : 0;
            //pnlCenter.Top = (this.Height - pnlCenter.Height) / 2 > 0 ? (this.Height - pnlCenter.Height) / 2 : 0;

        }

        private void btnPurchaseOrder_Click(object sender, EventArgs e)
        {
            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType().FullName == "YJY_DMZS.SupplyChain.FrmPurchaseOrder")
                {
                    form.Activate();
                    return;
                }
            }

            SupplyChain.FrmPurchaseOrder frm = new YJY_DMZS.SupplyChain.FrmPurchaseOrder();
            frm.MdiParent = this.MdiParent;
            frm.Show();
        }

        private void btnInStock_Click(object sender, EventArgs e)
        {
            //foreach (Form form in Application.OpenForms)
            //{
            //    if (form.GetType().FullName == "YJY_DMZS.SupplyChain.FrmInStock")
            //    {
            //        form.Activate();
            //        return;
            //    }
            //}

            SupplyChain.FrmInStock frm = new YJY_DMZS.SupplyChain.FrmInStock();
            frm.MdiParent = this.MdiParent;
            frm.Show();
        }

        private void btnSalesOrder_Click(object sender, EventArgs e)
        {
            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType().FullName == "YJY_DMZS.SupplyChain.FrmSalesOrder")
                {
                    form.Activate();
                    return;
                }
            }

            SupplyChain.FrmSalesOrder frm = new YJY_DMZS.SupplyChain.FrmSalesOrder();
            frm.MdiParent = this.MdiParent;
            frm.Show();
        }

        private void btnOutStock_Click(object sender, EventArgs e)
        {
            //foreach (Form form in Application.OpenForms)
            //{
            //    if (form.GetType().FullName == "YJY_DMZS.SupplyChain.FrmInStock")
            //    {
            //        form.Activate();
            //        return;
            //    }
            //}

            SupplyChain.FrmOutStock frm = new YJY_DMZS.SupplyChain.FrmOutStock();
            frm.MdiParent = this.MdiParent;
            frm.Show();
        }
    }
}
